package com.wy._05Random.Enum;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;


//是不是能把 除了汉字，英文呀，数字呀，各种其他字符也 做一个枚举？ 做枚举的话要混不要在一起
public enum ChineseCharacterEnum {
    Basic_Chinese_Character(new UnicodeFragment("Basic Chinese character", 0x4E00, 0x9FA5)),

    Basic_Chinese_Character_Supplement(new UnicodeFragment("Basic Chinese character supplement", 0X9FA6, 0X9FFF)),

    Extension_A(new UnicodeFragment("Extension A", 0X3400, 0X4DBF)),

    Extension_B(new UnicodeFragment("Extension B", 0X20000, 0X2A6DF)),

    Extension_C(new UnicodeFragment("Extension C", 0X2A700, 0X2B739)),

    Extension_D(new UnicodeFragment("Extension D", 0X2B740, 0X2B81D)),

    Extension_E(new UnicodeFragment("Extension E", 0X2B820, 0X2CEA1)),

    Extension_F(new UnicodeFragment("Extension F", 0X2CEB0, 0X2EBE0)),

    Extension_G(new UnicodeFragment("Extension G", 0X30000, 0X3134A)),

    Extension_H(new UnicodeFragment("Extension H", 0X31350, 0X323AF));

    private static final int count = Arrays.stream(values()).mapToInt(value -> value.getUnicodeFragment().getCount()).sum();
    private static final List<UnicodeFragment> unicodeFragmentList = Arrays.stream(values()).map(ChineseCharacterEnum::getUnicodeFragment).collect(Collectors.toList());

    private final UnicodeFragment unicodeFragment;

    public UnicodeFragment getUnicodeFragment() {
        return unicodeFragment;
    }

    public static int getCount() {
        return count;
    }

    public static List<UnicodeFragment> getUnicodeFragmentList() {
        return unicodeFragmentList;
    }

    ChineseCharacterEnum(UnicodeFragment unicodeFragment) {
        this.unicodeFragment = unicodeFragment;
    }
}commonEncryptionAlgorithms